package com.zc.tools.motionwelder.support;

import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class C2dMSpriteImageLoader implements MSpriteImageLoader {
	private TextureRegion[] regions;

	public C2dMSpriteImageLoader(TextureRegion[] regions) {
		this.regions = regions;
	}

	@Override
	public TextureRegion[] loadImageClip(String spriteName, int imageId,
			int x, int y, int w, int h, int orientationUsedInStudio) {
		
		TextureRegion[] rets = new TextureRegion[4];
		TextureRegion region1 = new TextureRegion(regions[imageId], x, y, w,h);
		TextureRegion region2 = new TextureRegion(regions[imageId], x, y, w,h);
		region2.flip(true, false);
		TextureRegion region3 = new TextureRegion(regions[imageId], x, y, w,h);
		region3.flip(false, true);
		TextureRegion region4 = new TextureRegion(regions[imageId], x, y, w,h);
		region4.flip(true, true);
		rets[0] = region1;
		rets[1] = region2;		
		rets[2] = region3;
		rets[3] = region4;
		return rets;
	}

	@Override
	public TextureRegion[] loadImage(String spriteName, int imageId,int orientationUsedInStudio) {
		return null;
	}

}
